const fetchData = ({ params = {}, timeout = 1500, isError = false }) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      if (!isError) {
        resolve({
          status_code: 0,
          data: {
            ...params,
          },
        });
      } else {
        reject("404 not found");
      }
    }, timeout);
  });
};

export default fetchData;
